// mixins/getMutiLine.js
import settings from '@/settings'
export default {
  methods: {
    //获取多行
    getMutiLine(text, num = settings.str_split) {
      if (text) {
        const SPLIT = num
        let lines = []
        let lengths = text.length
        let splitNum = lengths / SPLIT
        if (splitNum > 0) {
          for (let index = 0; index < splitNum; index++) {
            const element = text.slice(index * SPLIT, (index + 1) * SPLIT);
            lines.push(element)
          }
        } else {
          lines.push(text)
        }
        return lines.join('<br/>')
      }
    }
  }
}